package cn.fuxue.hrms.service.process;

import cn.fuxue.hrms.common.base.BaseEntityProcessor;
import cn.fuxue.hrms.common.base.BaseMapper;
import cn.fuxue.hrms.common.entity.CvProjectExp;
import cn.fuxue.hrms.mapper.CvProjectExpMapper;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.Map;

@Service
public class CvProjectExpProcessor extends BaseEntityProcessor<CvProjectExp> {
    @Autowired
    private CvProjectExpMapper cvProjectExpMapper;


    private Integer cvId;

    public Integer getCvId() {
        return cvId;
    }

    public void setCvId(Integer cvId) {
        this.cvId = cvId;
    }

    @Override
    protected CvProjectExp validate(Map map) {
        CvProjectExp cvProjectExp=new CvProjectExp();
        try {
            map.put("cvId",getCvId());
            cvProjectExp.populateFromJson(map);
            return cvProjectExp;
        } catch (Exception e) {
            return cvProjectExp;
        }
    }


    @Override
    protected Integer save(CvProjectExp entity) {
        return cvProjectExpMapper.insert(entity);
    }
}
